<{include file="header.htm"}>

<script src="<{$tpl_img}>images/common.js" type="text/javascript"></script>

<!--{if $a == 'ls'}-->

	<script type="text/javascript">
		function switchbtn(btn) {
			$('srchuserdiv').style.display = btn == 'srch' ? '' : 'none';
			$('srchuserdiv').className = btn == 'srch' ? 'tabcontentcur' : '' ;
			$('srchuserbtn').className = btn == 'srch' ? 'tabcurrent' : '';
			$('adduserdiv').style.display = btn == 'srch' ? 'none' : '';
			$('adduserdiv').className = btn == 'srch' ? '' : 'tabcontentcur';
			$('adduserbtn').className = btn == 'srch' ? '' : 'tabcurrent';
		}
	</script>

	<div class="container">
    	<?php
       /** if(!empty($_GET['msg'])){
        ?>
    	<div class="<?php if($_GET['status'] > 0){echo 'correctmsg';} else{echo 'errormsg';} ?>"><p><?php echo $_GET['msg'] ?></p></div>
    	<?php }**/?>
		<div class="hastabmenu">
			<ul class="tabmenu">
				<li id="srchuserbtn" class="tabcurrent"><a href="#" onclick="switchbtn('srch')">搜索用户</a></li>
				<li id="adduserbtn"><a href="#" onclick="switchbtn('add')">新增用户</a></li>
			</ul>
			<div id="adduserdiv" class="tabcontent" style="display:none;">
				<form action="<{spUrl c=member a=add}>" method="post">
				<table width="100%">
					<tr>
						<td>用户名:</td>
						<td><input type="text" name="username" class="txt" /></td>
						<td>密码:</td>
						<td><input type="password" name="password" class="txt" /></td>
					</tr>
                    <tr>
                    	<td>电子邮箱:</td>
						<td><input type="text" name="email" class="txt" /></td>
                        <td>群组</td>
                        <td><select name="groupid"><{html_options options=$group_options}></select>
                        <td><input type="submit" value="新增"  class="btn" /></td>
                    </tr>
				</table>
				</form>
			</div>
			<div id="srchuserdiv" class="tabcontentcur">
				<form action="<{spUrl c=member a=search}>" method="post">
				<table width="100%">
					<tr>
						<td>用户名:</td>
						<td><input type="text" name="username" value="" class="txt" /></td>
						<td>群组</td>
                        <td><select name="groupid"><{html_options options=$group_options}>
</select>
						<td>邮箱:</td>
						<td><input type="text" name="email" value="" class="txt" /></td>
						<td rowspan="2"><input type="submit" value="搜索" class="btn" /></td>
					</tr>
				</table>
				</form>
			</div>
		</div>

		
<br />
		<h3>用户列表</h3>
		<div class="mainbox">
			<!--{if $userlist}-->
				<form action="<{spUrl c=member a=delete}>" onsubmit="return confirm('您确认要删除这些用户吗');" method="post">
				<table class="datalist fixwidth" onmouseover="addMouseEvent(this);">
					<tr>
						<th><input type="checkbox" name="chkall" id="chkall" onclick="checkall('delete[]')" class="checkbox" /><label for="chkall">删除？</label></th>
						<th>用户名</th>
						<th>邮箱地址</th>
						<th>归属群组</th>
						<th>编辑</th>
					</tr>
					<{section name=i loop=$memberlist}>
						<tr height="60px">
							<td class="option"><input type="checkbox" name="delete[]" value="<{$memberlist[i].ucid}>" class="checkbox" /></td>
							<td><strong><{$memberlist[i].username}></strong></td>
							<td><{$memberlist[i].email}></td>
							<td><{$memberlist[i].groupid}></td>
							<td><a href="<{spUrl c=member a=edit_page ucid=$memberlist[i].ucid}>">编辑</a></td>
						</tr>
					<{/section}>
					<tr class="nobg">
						<td><input type="submit" value="删除所选用户" class="btn" /></td>
						<td class="tdpage" colspan="6"><div class="pages"><em>&nbsp;<{$pager.total_page}>&nbsp;</em><a href="<{spUrl c=member a=index page=$pager.prev_page}>" class="prev">&lsaquo;&lsaquo;</a><strong>当前第<{$page}>页</strong><a href="<{spUrl c=member a=index page=$pager.next_page}>" class="next">&rsaquo;&rsaquo;</a></div></td>
					</tr>
				</table>
				</form>
                
		</div>
	</div>

